home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 1 / Gekikoh Dennoh Club Vol. 1 (Japan).7z / Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin / tools / xb / sample / 2dan.bas < prev    next >
Encoding:
BASIC Source File  |  1995-06-17  |  1.0 KB  |  49 lines

  1.  
  2.  /* 2段独立スクロール
  3.  
  4. int x,y,s
  5. int x1,y1,x2,y2
  6. dim d(0,0)        /* データは境目のところだけ
  7. screen 0,3,1,1
  8. sp_init():sp_clr(0)
  9. spfile_def("cat2.sp",1)
  10. palfile_def("cat2.pal",1)
  11. sp_disp(1):sp_on(0,127)
  12. bg_set(0,0,1)
  13.  
  14.  /* 猫を敷き詰める
  15. for x=0 to 30:for y=0 to 30:s=(x and 1)*&h100
  16. bg_put(0,(y and 1)+x*2  ,y*2  ,&h108+s)
  17. bg_put(0,(y and 1)+x*2  ,y*2+1,&h109+s)
  18. bg_put(0,(y and 1)+x*2+1,y*2  ,&h10a+s)
  19. bg_put(0,(y and 1)+x*2+1,y*2+1,&h10b+s)
  20. next:next
  21.  
  22.  /* ラスタスクロールデータのセット
  23. ras_scroll_set(2,d,,,300)
  24. ras_scroll_stat(1)
  25.  
  26. x1=0:y1=0:x2=0:y2=0
  27. while strig(1)=0    /* なんか押したら終わり
  28.  
  29.  /* main loop
  30. s=stick(1)
  31. if s=2 then y1=y1-1
  32. if s=4 then x1=x1+1
  33. if s=6 then x1=x1-1
  34. if s=8 then y1=y1+1
  35. x1=x1 and &h1ff:y1=y1 and &h1ff
  36. ras_home(x1,y1)        /* 上半分
  37.  
  38. s=stick(2)
  39. if s=2 then y2=y2-1
  40. if s=4 then x2=x2+1
  41. if s=6 then x2=x2-1
  42. if s=8 then y2=y2+1
  43. d(0,0)=((x2 and &h1ff)shl 16) + (y2 and &h1ff)    /* 下半分
  44.  
  45. for s=0 to 100:next
  46.  /* 高クロック・030 ユーザは適当にウエイトを入れましょう
  47. endwhile
  48.  
  49.